﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="cn.kgc.news.pojo.Detail"%>
<%@page import="cn.kgc.news.service.impl.DetailServiceImpl"%>
<%@page import="cn.kgc.news.service.DetailService"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../common/common.jsp"%>
<html>
<head>
<link href="<%=request.getContextPath()%>/css/common.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/ckeditor/ckeditor.js">
	
</script>
</head>
<body>
	<div class="main-content-right">
		${param.id }
		<%
			//获取参数
			Integer id = Integer.parseInt(request.getParameter("id"));
			DetailService deService = new DetailServiceImpl();
			if(id == null){
				id = 1;
			}
			Detail detail = deService.getNewsDetail(id);
			//将获取到的对象放入作用域中，然后通过EL表达式在进行获取
			request.setAttribute("news", detail);
		%>
		<div class="main-text-box">
			<div class="main-text-box-tbg">
				<div class="main-text-box-bbg">
					<div class="article-box">
						<!--新闻的标题-->
						<h1><c:out value="${news.title }" default="没找到值" escapeXml="true"/></h1>
						<div class="source-bar">发布者：<c:out value="${news.auth }"/> 分类：新闻信息 更新时间：<c:out value="${news.createDate }" /> </div>
						<div class="article-content">
							<span class="article-summary"><b>摘要：<c:out value="${news.summary }" escapeXml="true"/></b></span>
							${news.content }
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 设置变量 -->
		<c:set var="msg" value="jstl提供的变量" scope="request"/>
		<!-- 输出变量 -->
		<c:out value="${msg }"/>
	</div>
</body>
</html>